<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>点击切换图片</title>
    <script src="vue.js"></script>
</head>
<body>
    

    <div id="s">
        <img src="img/tupian1.jpg" v-show="ok">
        <img src="img/tupian2.jpg" v-show="!ok">
        <br>
        <button @click="change">点我切换图片</button>
    </div>


    <script type="text/javascript">
        var vm =new Vue({
            el: '#s',
            data: {
                ok:true
            },
            methods:{
                change(){
                    this.ok=!this.ok
                }
            }
        })

    </script>
</body>
</html>